put cd fld 1 & return & cd fld 2 & return & cd fld 3 into container
put "PICT Maker Documentation" into prompt
PrintDoc prompt,container,prompt,times,12
end mouseUp
-- part 6 (field)
-- low flags: 81
-- high flags: 2007
-- rect: left=203 top=69 right=271 bottom=500
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name:
----- HyperTalk script -----
on mouseDown
set the lockText of me to false
click at the clickLoc
click at the clickLoc
put selection into theSelect
if theSelect Γëá "Click here to go there" then
click at loc of target
else
go cd "Auxiliary X-Commands"
send mouseUp to cd btn "ColorOn XFCN"
end if
set the lockText of me to true
end mouseDown
-- part 7 (button)
-- low flags: 80
-- high flags: A004
-- rect: left=283 top=278 right=299 bottom=434
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Close Information
----- HyperTalk script -----
on mouseUp
closeall
end mouseUp
-- part 8 (field)
-- low flags: 81
-- high flags: 2007
-- rect: left=203 top=69 right=271 bottom=500
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name:
----- HyperTalk script -----
on mouseUp
end mouseup
-- part 10 (field)
-- low flags: 81
-- high flags: 2007
-- rect: left=203 top=69 right=271 bottom=500
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 10
-- style flags: 0
-- line height: 13
-- part name:
----- HyperTalk script -----
on mouseUp
end mouseup
-- part contents for card part 6
----- text -----
ShowDialog XCMD supports very sophisticated handling of PICT resources for the display of graphics within ShowDialog dialog boxes. Ordinarily, you would create your graphic in a paint application such as MacPaintΓäó or SuperPaintΓäó and copy the artwork into a stack using ResEdit.
HyperCard itself is an excellent painting application.
So if you prefer, you can prepare your artwork in this stack. PICT Maker will convert your artwork into a PICT resource and save it into this stack.
Since HyperCard's painting tools are limited to black & white, if you wish to make color PICTs you'll still have to use ResEdit to install them into a stack.
Color PICTs can be created using programs such as PixelPaintΓäó and Studio 8 or any of the other color paint programs available for the Mac II. After creating the color graphic, select it and copy it to the clipboard. Open the "destination" stack with ResEdit and paste in the graphic as a PICT resource.
Be sure to test your finished dialog that contains a color PICT in B&W mode to make sure that the PICT still looks "allright" in B&W. There doesn't seem to be any rule-of-thumb for predicting how certain colors will look when displayed in B&W. You just have to try it and see.
Your better alternative is to employ the ColorOn XFCN that is included in this stack to test if your monitor is in color mode or not. If it is, show a dialog containing a color PICT; if it's in B&W mode, show another dialog, containing an identical, but B&W PICT. That way you can have your cake and eat it too!
See the card "Auxiliary X-Commands" for a description of ColorOn XFCN.
• Click here to go there. •
-- part contents for card part 8
----- text -----
PICT Maker uses an XFCN called Ants that returns the coordinates of a rectangle drawn out with the mouse and an XMCD called ClipToPICT to copy whatever picture is on the clipboard into a PICT resource and place it in the current stack.
The arguments of ClipToPICT XCMD are:
ClipToPICT <new PICT resource ID>,<new PICT name>
where
<new PICT resource ID>
is the resource ID number for the new PICT;
<new PICT name> is the name of the new PICT resource.
If you pass "0" (that's a zero) as the first parameter, ClipToPICT will assign its own unique ID to the new resource.
If you leave the second parameter empty (that doesn't mean that you can OMIT the second parameter) then the new PICT will be unnamed.
If everything goes alright the ID of the new PICT resource will be returned in "the result." If something goes wrong the following errors are returned in the result:
Error: You must provide 2 parameters (PICT ID and name)!
Error: That PICT resource ID already exists!
Error: That PICT name already exists!
Error: There isn't a picture on the clipboard!
Error: Unable to open the stack!
Any disk related errors will be reported by
Error: <OSError>
where <OSError> is one of the standard Macintosh operating system error codes. The ones that you potentially will encounter with ClipToPICT are:
-34: disk full
-44: disk locked
-61: file locked
As you can deduce from the error messages, ClipToPICT will not write over a previously existing PICT resource if it has the same ID or name as the new one. If there isn't anything on the clipboard (or there is text), ClipToPICT will exit without creating a resource.